package com.asiainfo.www.function;

import com.asiainfo.www.pojo.StatFile;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.streaming.connectors.redis.common.mapper.RedisCommand;
import org.apache.flink.streaming.connectors.redis.common.mapper.RedisCommandDescription;
import org.apache.flink.streaming.connectors.redis.common.mapper.RedisMapper;

/**
 * @author loso
 */
public class RedisStatMapper  implements RedisMapper< StatFile> {

    @Override
    public RedisCommandDescription getCommandDescription() {
        return new RedisCommandDescription(RedisCommand.SET, null);
    }

    @Override
    public String getKeyFromData(StatFile data) {
        return data.getDestFileName();
    }
    @Override
    public String getValueFromData(StatFile data) {
        return data.toString();
    }
}
